/**
 * @UiEvent.cpp
 * Copyright 2013 (C) FatalEror / Dean Bahari
 * 
 * UiPack is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * See LICENSE file in main folder for more information.
 */

#include "UiCommon.hpp"
#include "UiEvent.hpp"

UiEvent::UiEvent()
{
}

UiEvent::UiEvent(int left, int top, int right, int bottom)
{
	mRect.left   = left;
	mRect.top    = top;
	mRect.right  = right;
	mRect.bottom = bottom;
}

UiEvent::UiEvent(RECT rc)
{
	mRect = rc;
}

UiEvent::UiEvent(int x, int y)
{
	mPoint.x = x;
	mPoint.y = y;
}

UiEvent::UiEvent(POINT pt)
{
	mPoint = pt;
}

UiEvent::UiEvent(bool toggle)
{
	mToggle = toggle;
}

UiEvent::UiEvent(int state)
{
	mState = state;
}

UiEvent::UiEvent(HDC hDC)
{
	mDC = hDC;
}

int UiEvent::getWidth()
{
	return mPoint.x;
}

int UiEvent::getHeight()
{
	return mPoint.y;
}

int UiEvent::getPosX()
{
	return mPoint.x;
}

int UiEvent::getPosY()
{
	return mPoint.y;
}

int UiEvent::getLeft()
{
	return mRect.left;
}

int UiEvent::getTop()
{
	return mRect.top;
}

int UiEvent::getRight()
{
	return mRect.right;
}

int UiEvent::getBottom()
{
	return mRect.bottom;
}

HDC UiEvent::getDC()
{
	return mDC;
}

POINT UiEvent::getPoint()
{
	return mPoint;
}

RECT UiEvent::getRect()
{
	return mRect;
}

int UiEvent::getState()
{
	return mState;
}

bool UiEvent::isLeftClick()
{
	return ((mState & (UiEvent::UI_MOUSE_CLICK | UiEvent::UI_MOUSE_LEFT)) > 0);
}

bool UiEvent::isRightClick()
{
	return ((mState & (UiEvent::UI_MOUSE_CLICK | UiEvent::UI_MOUSE_RIGHT)) > 0);
}

bool UiEvent::isMiddleClick()
{
	return ((mState & (UiEvent::UI_MOUSE_CLICK | UiEvent::UI_MOUSE_MIDDLE)) > 0);
}

bool UiEvent::isLeftRelease()
{
	return ((mState & (UiEvent::UI_MOUSE_RELEASE | UiEvent::UI_MOUSE_LEFT)) > 0);
}

bool UiEvent::isRightRelease()
{
	return ((mState & (UiEvent::UI_MOUSE_RELEASE | UiEvent::UI_MOUSE_RIGHT)) > 0);
}

bool UiEvent::isMiddleRelease()
{
	return ((mState & (UiEvent::UI_MOUSE_RELEASE | UiEvent::UI_MOUSE_MIDDLE)) > 0);
}